package com.maolong.fenkufenbiaotest.controller;

import com.maolong.fenkufenbiaotest.pojo.Employ;
import com.maolong.fenkufenbiaotest.pojo.User;
import com.maolong.fenkufenbiaotest.service.EmployService;
import com.maolong.fenkufenbiaotest.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.List;

@RestController
@Slf4j
@RequestMapping("/employ")
public class EmployController {
    @Autowired
    EmployService employService;

    @GetMapping("/getEmploy")
    public List<Employ> getEmploy(){
        List<Employ> employList = employService.getEmployList();
        return employList;
    }

    @PostMapping("/addEmploy")
    public String addEmploy(Employ employ){
        employService.insert();
        return "success";
    }
}
